\(\int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx\) [428]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 66 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {2 \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc (c+d x)}{a^2 d} \]

[Out]

arctanh(cos(d*x+c))/a^2/d-2*cot(d*x+c)/a^2/d-1/3*cot(d*x+c)^3/a^2/d+cot(d*x+c)*csc(d*x+c)/a^2/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2787, 2836, 3852, 8, 3853, 3855} \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {2 \cot (c+d x)}{a^2 d}+\frac {\cot (c+d x) \csc (c+d x)}{a^2 d} \]

[In]

Int[Cot[c + d*x]^4/(a + a*Sin[c + d*x])^2,x]

[Out]

ArcTanh[Cos[c + d*x]]/(a^2*d) - (2*Cot[c + d*x])/(a^2*d) - Cot[c + d*x]^3/(3*a^2*d) + (Cot[c + d*x]*Csc[c + d*
x])/(a^2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2787

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_), x_Symbol] :> Dist[a^p, Int[Sin[
e + f*x]^p/(a - b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p] &&
 EqQ[p, 2*m]

Rule 2836

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Int[Expan
dTrig[(a + b*sin[e + f*x])^m*(d*sin[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && EqQ[a^2 - b^2, 0] &
& IGtQ[m, 0] && RationalQ[n]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \csc ^4(c+d x) (a-a \sin (c+d x))^2 \, dx}{a^4} \\ & = \frac {\int \left (a^2 \csc ^2(c+d x)-2 a^2 \csc ^3(c+d x)+a^2 \csc ^4(c+d x)\right ) \, dx}{a^4} \\ & = \frac {\int \csc ^2(c+d x) \, dx}{a^2}+\frac {\int \csc ^4(c+d x) \, dx}{a^2}-\frac {2 \int \csc ^3(c+d x) \, dx}{a^2} \\ & = \frac {\cot (c+d x) \csc (c+d x)}{a^2 d}-\frac {\int \csc (c+d x) \, dx}{a^2}-\frac {\text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}-\frac {\text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{a^2 d} \\ & = \frac {\text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {2 \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc (c+d x)}{a^2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.08 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.83 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\left (1+\cot \left (\frac {1}{2} (c+d x)\right )\right )^4 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \left (-9 \cos (c+d x)+5 \cos (3 (c+d x))+6 \left (2 \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin ^3(c+d x)+\sin (2 (c+d x))\right )\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{96 a^2 d (1+\sin (c+d x))^2} \]

[In]

Integrate[Cot[c + d*x]^4/(a + a*Sin[c + d*x])^2,x]

[Out]

((1 + Cot[(c + d*x)/2])^4*Sec[(c + d*x)/2]^2*(-9*Cos[c + d*x] + 5*Cos[3*(c + d*x)] + 6*(2*(Log[Cos[(c + d*x)/2
]] - Log[Sin[(c + d*x)/2]])*Sin[c + d*x]^3 + Sin[2*(c + d*x)]))*Tan[(c + d*x)/2])/(96*a^2*d*(1 + Sin[c + d*x])
^2)

Maple [A] (verified)

Time = 0.40 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.42

method result size
parallelrisch \(\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )-\left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-6 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+6 \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-24 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+21 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-21 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )}{24 d \,a^{2}}\) \(94\)
derivativedivides \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-8 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {7}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}}{8 d \,a^{2}}\) \(98\)
default \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-8 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {7}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}}{8 d \,a^{2}}\) \(98\)
risch \(-\frac {2 \left (3 i {\mathrm e}^{4 i \left (d x +c \right )}+3 \,{\mathrm e}^{5 i \left (d x +c \right )}-12 i {\mathrm e}^{2 i \left (d x +c \right )}+5 i-3 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 a^{2} d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d \,a^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d \,a^{2}}\) \(111\)
norman \(\frac {-\frac {1}{24 a d}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d a}-\frac {\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d a}+\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d a}-\frac {\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d a}+\frac {\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )}{24 d a}-\frac {23 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d a}-\frac {29 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}-\frac {17 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}}\) \(207\)

[In]

int(cos(d*x+c)^4*csc(d*x+c)^4/(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/24*(tan(1/2*d*x+1/2*c)^3-cot(1/2*d*x+1/2*c)^3-6*tan(1/2*d*x+1/2*c)^2+6*cot(1/2*d*x+1/2*c)^2-24*ln(tan(1/2*d*
x+1/2*c))+21*tan(1/2*d*x+1/2*c)-21*cot(1/2*d*x+1/2*c))/d/a^2

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.86 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {10 \, \cos \left (d x + c\right )^{3} - 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 6 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 12 \, \cos \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/6*(10*cos(d*x + c)^3 - 3*(cos(d*x + c)^2 - 1)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 3*(cos(d*x + c)^2
- 1)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 6*cos(d*x + c)*sin(d*x + c) - 12*cos(d*x + c))/((a^2*d*cos(d*
x + c)^2 - a^2*d)*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**4*csc(d*x+c)**4/(a+a*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 153 vs. \(2 (64) = 128\).

Time = 0.22 (sec) , antiderivative size = 153, normalized size of antiderivative = 2.32 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {6 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {24 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {{\left (\frac {6 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {21 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{3}}{a^{2} \sin \left (d x + c\right )^{3}}}{24 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/24*((21*sin(d*x + c)/(cos(d*x + c) + 1) - 6*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + sin(d*x + c)^3/(cos(d*x +
c) + 1)^3)/a^2 - 24*log(sin(d*x + c)/(cos(d*x + c) + 1))/a^2 + (6*sin(d*x + c)/(cos(d*x + c) + 1) - 21*sin(d*x
 + c)^2/(cos(d*x + c) + 1)^2 - 1)*(cos(d*x + c) + 1)^3/(a^2*sin(d*x + c)^3))/d

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.94 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {\frac {24 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} - \frac {44 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 21 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}} - \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 21 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{24 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-1/24*(24*log(abs(tan(1/2*d*x + 1/2*c)))/a^2 - (44*tan(1/2*d*x + 1/2*c)^3 - 21*tan(1/2*d*x + 1/2*c)^2 + 6*tan(
1/2*d*x + 1/2*c) - 1)/(a^2*tan(1/2*d*x + 1/2*c)^3) - (a^4*tan(1/2*d*x + 1/2*c)^3 - 6*a^4*tan(1/2*d*x + 1/2*c)^
2 + 21*a^4*tan(1/2*d*x + 1/2*c))/a^6)/d

Mupad [B] (verification not implemented)

Time = 10.06 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.80 \[ \int \frac {\cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,a^2\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,a^2\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}+\frac {7\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,a^2\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {1}{3}\right )}{8\,a^2\,d} \]

[In]

int(cos(c + d*x)^4/(sin(c + d*x)^4*(a + a*sin(c + d*x))^2),x)

[Out]

tan(c/2 + (d*x)/2)^3/(24*a^2*d) - tan(c/2 + (d*x)/2)^2/(4*a^2*d) - log(tan(c/2 + (d*x)/2))/(a^2*d) + (7*tan(c/
2 + (d*x)/2))/(8*a^2*d) - (cot(c/2 + (d*x)/2)^3*(7*tan(c/2 + (d*x)/2)^2 - 2*tan(c/2 + (d*x)/2) + 1/3))/(8*a^2*
d)